import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
import  home from './../pages/home/home'
import  category from './../pages/category/category'
import  shopcart from './../pages/shopcart/shopcart'
import  user from './../pages/user/user'
import  search from './../pages/search/search'
import  productList from './../pages/product-list/product-list'

import  productDetail from './../pages/product-detail/product-detail'
import  login from './../pages/login/login'
import register from './../pages/register/register'
// import navBar from './../components/navBar'
Vue.use(Router)


export default new Router({



  routes: [
    // {
    //   path: '/',
    //   name: 'HelloWorld',
    //   component: HelloWorld
    // },
    {
      path:'/',
      redirect:'/home'},
    {
      path:'/home',
      // name:'home',
      component: home
    },
    {
      path:'/category',
      component: category
    },
    {
      path:'/shopcart',
      component: shopcart
    },
    {
      path:'/user',
      component:user
    },
    {
      path:'/search',
      component:search
    },
    // 商品列表
    {
      path:'/product-list',
      component:productList
    },
    {
      path:'/product/:id',
      meta:{
        index:4
      },
      component:productDetail
    },
    {
      path:'/login',
      component:login
    },
    {
      path:'/register',
      component:register
    }
  ]
})
